<?php
defined ( 'CITY_BAO' ) or exit ( 'Access Denied' );
require CB_CORE . 'modules/' . $config_module ['module'] . '/common.inc.php';
require CB_INCLUDE . 'datalist.class.php';
$action = $request->getActionName ();
if ($action == 'expend') {

} elseif ($action == 'earn') {

} elseif ($action == 'buy') {
	
} elseif ($action == 'virement') {
	
}else{
	$page = $request->getParam('page');
	$type = $request->getParam('type');
	$sql = 'SELECT * FROM {#cbdbPrefix}credit_log WHERE userid='.$user->userid;
	if($type == 'in'){
		$sql.=' AND amount>0';
	}elseif($type == 'out'){
		$sql.=' AND amount<0';
	}
	$datalist = new datalist ();
	$datalist->setQuery ( $sql );
	$datalist->setCurrentPage($page);
	$tpl->assign('data',$datalist->getData ());
	$tpl->assign('pageControl',$datalist->getPages ());
	$tpl->display('member/credit.tpl');
}